function selectRoles(userid) {
  var url = "user.x?op=select&u.id=" + userid;
  var retVal = window.showModalDialog(url,null,"dialogwidth:800px;dialogheight:700px");    
  _obj("id_op").value = "edit";
  if (retVal !== undefined && retVal !== '')
    _obj("editFrm").submit();
}

function submitRoles() {
  _obj("id_op").value = "config";
  _obj("cfgFrm").submit();
}

function selectEnt() {
  var url = "user.x?op=selectEnt";
  var retVal = window.showModalDialog(url,null,"dialogwidth:800px;dialogheight:700px");    
  if (retVal !== undefined && retVal !== '') {
    _obj("id_u_enterpriseId").value = retVal[0];
    _obj("id_u_enterpriseName").value = retVal[1];
    _obj("id_u_enterpriseCname").value = retVal[2];
  }
}

function submitEnt() {
  var ischecked = false;
  var entVal = new Array(3);
  var radios = document.getElementsByName("entId");
  for(var i = 0; i < radios.length; i++) {
    if(radios[i].checked) {
      ischecked = true;
      entVal[0] = radios[i].value;
      entVal[1] = radios[i].entname;
      entVal[2] = radios[i].entcname;
      break;
    }
  }
  window.returnValue = entVal;
  window.close();
}

function addUser() {
  _obj("id_op").value = "edit";
  _obj("listFrm").submit();
}

function delUser() {
  if (confirm('是否要删除选中用户?')) {
    commit('listFrm',[['id_op','delete']]);
  }
}

// 2008.1.8 yipeng 添加ICG用户
function addIcgUser(icgUser) {
  _obj("id_op").value = "edit";
  _obj("id_u_userType").value = icgUser;
  _obj("listFrm").submit();
}

// 2008.3.3 yipeng 返回企业列表
function backToEntList() {
    _obj("listFrm").action = "enterpriseinfo.x";
    document.getElementsByName("f(enterpriseId)")[0].removeNode(); // 删除隐藏的搜索参数enterpriseId
    commit('listFrm',[['id_op','find']]);
}